package com.xmall.pethouse_api.service.impl;

import com.xmall.pethouse_api.mapper.AddressMapper;
import com.xmall.pethouse_api.pojo.entity.UserAddress;
import com.xmall.pethouse_api.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AddressServiceImpl implements AddressService {
    @Autowired
    private AddressMapper addressMapper;

    @Override
    public List<UserAddress> findByUserId(Long userId) {
        return addressMapper.findByUserId(userId);
    }

    @Override
    public void addAddress(UserAddress address) {
        addressMapper.insert(address);
    }

    @Override
    public void deleteAddress(Long id) {
        addressMapper.delete(id);
    }
} 